package com.netease.b.b.h;

import com.netease.a.b.h;
import com.netease.b.b.e.f;
import com.netease.b.b.e.k;
import com.netease.framework.a.m;
import com.netease.pris.a.i;
import com.netease.pris.c.l;
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URLDecoder;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;

public class c extends k
{
  private String a;
  private String b;
  private String j;
  private String k;
  private String l;
  private String m;
  private String n;
  private String o;
  private String p;
  private String q;
  private m z;

  protected c(int paramInt)
  {
    super(paramInt);
  }

  public static com.netease.framework.b.a a(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7, String paramString8, String paramString9, String paramString10)
  {
    c localc = new c(4097);
    localc.q = paramString1;
    localc.a = paramString2;
    localc.b = paramString3;
    localc.j = paramString4;
    localc.k = paramString5;
    localc.l = paramString6;
    localc.m = paramString7;
    localc.n = paramString8;
    localc.o = paramString9;
    localc.p = paramString10;
    return localc;
  }

  private void a(String paramString1, String paramString2)
  {
    d.a().a(paramString1, paramString2);
  }

  private boolean a()
  {
    int i = 1;
    String[] arrayOfString = l.c(com.netease.b.a.d.h().a(), this.q, 7);
    if ((arrayOfString != null) && (arrayOfString.length == 2) && (!i.e(arrayOfString[0])))
      a(arrayOfString[0], arrayOfString[i]);
    while (true)
    {
      return i;
      i = 0;
    }
  }

  private m b()
  {
    String str = d.a().b("/records/add.json");
    try
    {
      ArrayList localArrayList = new ArrayList();
      localArrayList.add(new com.netease.a.b.g("access_token", URLDecoder.decode(d.a().b().d)));
      localArrayList.add(new com.netease.a.b.g("content", this.a, "utf-8"));
      if (!com.netease.c.b.a(this.b))
        localArrayList.add(new com.netease.a.b.g("save_to_album", this.b, "utf-8"));
      if (!com.netease.c.b.a(this.j))
        localArrayList.add(new com.netease.a.b.g("location", this.j, "utf-8"));
      if (!com.netease.c.b.a(this.k))
        localArrayList.add(new com.netease.a.b.g("lat", this.k, "utf-8"));
      if (!com.netease.c.b.a(this.l))
        localArrayList.add(new com.netease.a.b.g("lon", this.l, "utf-8"));
      if (!com.netease.c.b.a(this.m))
        localArrayList.add(new com.netease.a.b.g("sync_status", this.m, "utf-8"));
      if (!com.netease.c.b.a(this.n))
        localArrayList.add(new com.netease.a.b.g("spri", this.n, "utf-8"));
      if (!com.netease.c.b.a(this.p))
        localArrayList.add(new com.netease.a.b.g("picurl", this.p, "utf-8"));
      if ((!com.netease.c.b.a(this.o)) && (new File(this.o).exists()))
        localArrayList.add(new com.netease.a.b.b("pic", new File(this.o)));
      com.netease.a.b.a[] arrayOfa = new com.netease.a.b.a[localArrayList.size()];
      localArrayList.toArray(arrayOfa);
      h localh = new h(arrayOfa);
      localm = new m(str, com.netease.framework.a.b.b);
      localm.a(localh);
      return localm;
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      while (true)
      {
        localFileNotFoundException.printStackTrace();
        m localm = null;
      }
    }
  }

  private Object b(String paramString)
  {
    Object localObject = null;
    com.netease.b.b.e.g localg = new com.netease.b.b.e.g(7);
    try
    {
      String str = new JSONObject(paramString).optString("rid");
      if (i.e(str))
      {
        localObject = d.a().c(paramString);
      }
      else
      {
        localg.a(String.valueOf(str));
        if ((localg == null) || (!i.e(localg.b())))
          localObject = localg;
      }
    }
    catch (JSONException localJSONException)
    {
      while (true)
      {
        localJSONException.printStackTrace();
        localg = null;
      }
    }
    return localObject;
  }

  public void a(int paramInt, String paramString)
  {
    f localf = d.a().c(paramString);
    d(localf.h, localf);
  }

  public void a(String paramString)
  {
    Object localObject;
    switch (n())
    {
    default:
      localObject = null;
      if (o())
        break;
      if (localObject != null)
        if ((localObject instanceof f))
          d(((f)localObject).h, localObject);
    case 4097:
    case 4098:
    }
    while (true)
    {
      return;
      com.netease.g.b.e("BlogTransaction", paramString);
      localObject = b(paramString);
      break;
      localObject = b(paramString);
      break;
      c(0, localObject);
      continue;
      d(-1, null);
    }
  }

  public void c()
  {
    if (!a())
    {
      d(-2, null);
      com.netease.g.b.d("***********", "Error  withou token & secret to send blog");
    }
    while (true)
    {
      return;
      switch (n())
      {
      default:
      case 4097:
      }
      while (true)
      {
        if ((this.z == null) || (o()))
          break label80;
        a(this.z);
        break;
        this.z = b();
      }
      label80: d(-4, null);
      h();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.b.b.h.c
 * JD-Core Version:    0.6.0
 */